package com.itheima;
import java.util.LinkedList;
public class LinkListDemo {
    public static void main(String[] args) {
        LinkedList<String> list = new LinkedList<>();

        list.addFirst("zhangsan");
        list.addLast("lisi");
        list.addLast("wangwu");
        list.addLast("zhaoliu");
        list.addLast("qianqi");

        String s= list.get(3);
        System.out.println(s);

        String first = list.getFirst();
        System.out.println(first);

        String last = list.getLast();
        System.out.println(last);
    }
}
